package xyz.ddlnt.user.usr.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.entity.ExamQuestion;
import xyz.ddlnt.model.vo.ExamQuestionIntroVO;
import xyz.ddlnt.serviceusrclient.client.ExamQuestionFeignClient;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/5 1:29
 */
@Slf4j
@Tag(name = "试题查询测试接口")
@RequestMapping("/exam_question")
@RestController
@RequiredArgsConstructor
public class ExamQuestionController {

    private final ExamQuestionFeignClient examQuestionFeignClient;
    @Operation(summary = "根据技术科目Id查询试题简介")
    @GetMapping("/listExamQuesIntro/{technologyId}")
    Result<List<ExamQuestionIntroVO>> listExamQuestionIntro(@PathVariable Long technologyId) {
        return examQuestionFeignClient.listExamQuestionIntro(technologyId);
    }

    @Operation(summary = "根据技术科目Id查询试题目录")
    @GetMapping("/listExamQuesIntroDir/{technologyId}")
    public Result<List<ExamQuestionIntroVO>> listExamQuestionIntroDir(@PathVariable Long technologyId) {
        return examQuestionFeignClient.listExamQuestionIntroDir(technologyId);
    }

    @Operation(summary = "根据试题Id查询试题所有信息")
    @GetMapping("/examQuestionInfo/{questionId}")
    Result<ExamQuestion> examQuestionInfo(@PathVariable Long questionId) {
        return examQuestionFeignClient.getExamQuestionInfo(questionId);
    }
}
